// 是否合法的http/https域名
export const isHttpUrl = (str) => {
    return /^(http|https):\/\/[^\s]+$/.test(str);
}

// 手机号
export const isPhoneNumber = (str) => {
    return /^1[3456789]\d{9}$/.test(str);
}

// 身份证号
export const isIdCard = (str) => {
    return /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(str);
}

// 是否http/https
export const regHttp = (url) => {
    const Expression = /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;
    const objExp = new RegExp(Expression);
    return objExp.test(url)
}